export function getRem() {
  const width = window.innerWidth >= 1280 ? window.innerWidth : 1280
  const rem = width * (100 / 1920)
  return rem
}
export function debounce (func, delay = 100, ime = false) {
  let timer = null
  return function () {
    const context = this
    const args = arguments

    if (ime && timer === null) {
      timer = 'pending'
      return func.apply(context, args)
    }

    timer && clearTimeout(timer)
    timer = setTimeout(function () {
      func.apply(context, args)
      timer = null
    }, delay)
  }
}
